class Solution:
    def canConstruct(self, s: str, k: int) -> bool:
        if len(s) < k:
            return False
        if len(s) == k:
            return True
        counter = {}
        for string in s:
            if string not in counter:
                counter[string] = 0
            counter[string] += 1
        odd = 0
        for string, count in counter.items():
            if count % 2 != 0:
                odd += 1
        return odd <= k
